//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    carInfo: null
  },

  onLoad: function() {

  },
  onShow: function() {
    var that = this;
    wx.getStorage({
      key: 'carInfo',
      success: function(res) {
        that.setData({
          carInfo: res.data
        });
      },
    });
  },
  addCar: function() {
    wx.getSetting({
      success: res => {
        //console.log(res.authSetting);
        if (!res.authSetting["scope.userInfo"]) {
          wx.navigateTo({
            url: '../login/index',
          })
        } else {
          wx.navigateTo({
            url: '../car/index',
          });
        }
      }
    })
  }
})